Method and apparatus for ensuring data consistency

ABSTRACT

Embodiments of the present disclosure provide methods and apparatuses for ensuring data consistency. In some embodiments, a method comprises writing data into a first temporary buffer in a first processor. The method further comprises, in response to the data being written into the first temporary buffer, sending the data to a second processor to update a copy of the data in the second processor. In addition, the method comprises, in response to receiving an indication that the second processor has received the data, copying the data from the first temporary buffer to a first working buffer in the first processor.

RELATED APPLICATIONS

This application claim priority from Chinese Patent Application NumberCN201611192951.9, filed on Dec. 21, 2016 at the State IntellectualProperty Office, China, titled “METHOD AND APPARATUS FOR MAINTAININGDATA CONSISTENCY” the contents of which is herein incorporated byreference in its entirety.

FIELD

Embodiments of the present disclosure generally relate to the field ofdata storage, and more specifically, to methods and apparatuses forensuring data consistency.

BACKGROUND

In a common storage product, a system architecture including a pluralityof storage processors (SPs, also called processing nodes) attached witha shared disk is usually utilized to improve computing capability andinput/output (IO) throughput of the storage product. In such a storagesystem architecture, configuration information for managing disks (suchas, state information and a mapping table of a redundant array ofindependent disks) can be buffered in memories of the plurality of SPs,and the configuration information may be further stored in the shareddisk.

Upon occurrence of events, such as disk failure or disk array expansion,the configuration information on a certain SP might be updated. Then,the updated configuration information can be synchronized to other SPsand finally stored on the shared disk. During the above data updatingprocess, any SP might break down or be restarted due to software orhardware failure, resulting in data inconsistency among the memories ofthe plurality of SPs or among the memories and the shared disk. Thismight lead to severe impact on the user, such as unavailability or dataunavailability.

SUMMARY

Embodiments of the present disclosure provide methods and apparatusesfor ensuring data consistency.

In a first aspect of the present disclosure, there is provided a methodfor ensuring data consistency. The method comprises writing data into afirst temporary buffer in a first processor. The method furthercomprises, in response to the data being written into the firsttemporary buffer, sending the data to a second processor to update acopy of the data in the second processor. Furthermore, the methodfurther comprises, in response to receiving an indication that thesecond processor has received the data, copying the data from the firsttemporary buffer to a first working buffer in the first processor.

In a second aspect of the present disclosure, there is provided a methodfor ensuring data consistency. The method comprises, in response toreceiving from a first processor data to be updated, writing the datainto a second temporary buffer in a second processor. The method furthercomprises, in response to the data being written into the secondtemporary buffer, sending, to the first processor, an indication thatthe second processor has received the data. Moreover, the method furthercomprises copying the data from the second temporary buffer to a secondworking region in the second processor.

In a third aspect of the present disclosure, there is provided anapparatus for ensuring data consistency. The apparatus comprises atleast one processing unit and at least one memory, the at least onememory being coupled to the at least one processing unit and storinginstructions for execution by the at least one processing unit. Theinstructions, when executed by the at least one processing unit, causethe apparatus to: write data into a first temporary buffer in a firstprocessor; in response to the data being written into the firsttemporary buffer, send the data to a second processor to update a copyof the data in the second processor; and in response to receiving anindication that the second processor has received the data, copy thedata from the first temporary buffer to a first working buffer in thefirst processor.

In a fourth aspect of the present disclosure, there is provided anapparatus for ensuring data consistency. The apparatus comprises atleast one processing unit and at least one memory, the at least onememory being coupled to the at least one processing unit and storinginstructions for execution by the at least one processing unit. Theinstructions, when executed by the at least one processing unit, causethe apparatus to: in response to receiving from a first processor datato be updated, write the data into a second temporary buffer in a secondprocessor; in response to the data being written into the secondtemporary buffer, send, to the first processor, an indication that thesecond processor has received the data; and copy the data from thesecond temporary buffer to a second working buffer in the secondprocessor.

In a fifth aspect of the present disclosure, there is provided acomputer program product that is tangibly stored on a non-transientcomputer readable medium and includes machine-executable instructions.The machine-executable instructions, when being executed, cause themachine to execute any step of the method according to the first aspectof the present disclosure.

In the sixth aspect of the present disclosure, there is provided acomputer program product that is tangibly stored on a non-transientcomputer readable medium and includes machine-executable instructions.The machine-executable instructions, when being executed, cause themachine to execute any step of the method according to the second aspectof the present disclosure.

This Summary is provided to introduce a selection of concepts in asimplified form that are further described below in the DetailedDescription. This Summary is not intended to identify key features oressential features of the claimed present disclosure, nor is it intendedto be used to limit the scope of the claimed present disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other objectives, features, and advantages of exampleembodiments of the present disclosure will become more apparent from thefollowing detailed description with reference to the accompanyingdrawings, in which the same reference symbols refer to the sameelements.

FIG. 1 illustrates an architecture diagram of an example storage system100 with two SPs sharing a disk;

FIG. 2 illustrates an architecture diagram of a storage system 200according to the embodiments of the present disclosure;

FIG. 3 illustrates a flowchart of a method 300 for ensuring dataconsistency according to the embodiments of the present disclosure;

FIG. 4 illustrates a block diagram of an apparatus 400 for ensuring dataconsistency according to the embodiments of the present disclosure;

FIG. 5 illustrates a block diagram of an apparatus 500 for ensuring dataconsistency according to the embodiments of the present disclosure; and

FIG. 6 illustrates a block diagram of a computer system 600 adapted toimplement the example embodiments of the present disclosure.

Throughout the drawings, the same or corresponding reference symbols areused to indicate the same or corresponding parts.

DETAILED DESCRIPTION OF EMBODIMENTS

Preferred embodiments of the present disclosure will be described asfollows in greater detail with reference to the drawings. Althoughpreferred embodiments of the present disclosure are illustrated in thedrawings, it is to be understood that the present disclosure describedherein can be implemented in various manners, not limited to theembodiments illustrated herein. Rather, these embodiments are providedto make the present disclosure described herein clearer and morecomplete and convey the scope of the present disclosure described hereincompletely to those skilled in the art.

As used herein, the term “includes” and its variants are to be read asopen-ended terms that mean “includes, but is not limited to.” The term“or” is to be read as “and/or” unless the context clearly indicatesotherwise. The term “based on” is to be read as “based at least in parton.” The term “one example embodiment” and “an example embodiment” areto be read as “at least one example embodiment.” The term “anotherembodiment” is to be read as “at least one other embodiment.” Terms “afirst”, “a second” and others can denote different or identical objects.The following text may also contain other explicit or implicitdefinitions.

As described above, in a storage system with a plurality of SPs sharinga disk, if data on one SP is updated, the updated data can besynchronized to other SPs and finally stored on the disk. During thisprocess, any SP may break down or be restarted due to software orhardware failure, resulting in data inconsistency among the memories ofthe plurality of SPs or among the memories and the disk.

To solve the above problem or one or more other potential problems atleast in part, example embodiments of the present disclosure propose ascheme for ensuring data consistency. The scheme firstly updates thedata to a temporary buffer in a SP and copies the data from thetemporary buffer of the SP to a working buffer after the data has beenupdated to the temporary buffers of all the SPs in order to ensure dataconsistency among the memories of the plurality of SPs. Furthermore,during the process of flushing data from the memory of the SP to thedisk, the scheme ensures data consistency between the memory and thedisk by applying a temporary region on the disk.

FIG. 1 illustrates an architecture diagram of an example storage system100 with two SPs sharing a disk. As shown in FIG. 1, in the storagesystem 100, there are two SPs sharing disk(s) 103, namely, SP 101 and SP102. For the purpose of example, only two SPs are illustrated in FIG. 1.However, it is to be understood that the embodiments of the presentdisclosure may also apply to a storage system with multiple SPs.Furthermore, for the ease of depiction, a magnetic disk or a magneticdisk array will be used in the following as an example of the disk(s)103. However, this is only for the purpose of illustration. Any storagemedia currently known or to be developed in the future based on othermechanisms can possibly server as the disk(s) 103.

As shown in FIG. 1, two SPs can have their respective memories, namely,memories 111 and 112. The two SPs can interact with each other via acommand interface (CMI) 104 (for example, transmitting a heartbeatsignal with each other). During the booting of the SPs, the two SPs candetermine their respective roles through a handshake. For example, a SPthat is started earlier can serve as an active SP (also called a “firstSP”) and the other SP serves as a passive SP (also called a “secondSP”).

Generally, the active SP can be used to serve an IO request of thesystem. When the active SP fails, the IO request can be failed over tothe passive SP and served by the passive SP. For the ease of depiction,in the following text, SP 101 will be taken as an example of the activeSP, namely, the first SP. SP 102 will serve as the passive SP, namely,the second SP.

The disk(s) 103 can be a single disk or a disk array including aplurality of disks (such as a redundant array of independent disks(RAID)). For example, when the disk(s) 103 is a RAID, each disk thereincan be divided into a plurality of disk extents and several disk extentscan be organized into RAID stripes in a RAID group. Configurationinformation for managing the disk(s) 103 (such as state information ofthe disk extents and mapping relation among the RAID stripes and thedisk extents) can be buffered in the memories (such as the memories 111and 112) of the SPs (such as SP 101 and SP 102) and stored in thedisk(s) 103.

Upon occurrence of disk failure or disk extent expansion, theconfiguration information for managing the disk(s) 103 might need to beupdated. In other words, copies of the configuration information in thememory 111, memory 112 and memory 113 should be updated respectively.During the process of updating the configuration information, SP 101 orSP 102 might be restarted or break down due to software or hardwarefailure, resulting in data inconsistency among SP 101, SP 102 and thedisk(s) 103.

Embodiments of the present disclosure propose employing temporarybuffers in the memories of the SPs and a temporary region on the shareddisk to solve the above data inconsistency.

FIG. 2 illustrates an architecture diagram of a storage system 200according to the embodiments of the present disclosure. Same as thestorage system 100 as shown in FIG. 1, the storage system 200 may alsoinclude SP 101 and SP 102 which share the disk(s) 103 and interact witheach other via CMI 104.

SP 101 and SP 102 also have their respective memories, namely, thememories 111 and 112. Different from the storage system 100 as shown inFIG. 1, the memory 111 may include a working buffer 201 and a temporarybuffer 211. Similarly, the memory 112 may include a working buffer 202and a temporary buffer 212, where the working buffers 201 and 202 arevisible to the user and finally utilized to buffer the configurationinformation of the disk(s) 103. The temporary buffers (also called“shadow buffers”) 211 and 212 are invisible to the user and employed toensure data consistency between the memories 111 and 112. In someembodiments, the temporary buffer(s) 211 and/or 212 can be allocated inadvance. In some other embodiments, the temporary buffer(s) 211 and/or212 can be allocated temporarily for data to be updated, and releasedafter the data is copied to the working buffer(s) 201 and/or 202.

Furthermore, the disk(s) 103 may include a working region 203 and atemporary region (also called journal region) 204, where the workingregion 203 may be used for storing the configuration information of thedisk(s) 103 finally, and the temporary region 204 may be employed toensure data consistency among the memories 111 and 112 and the disk(s)103.

FIG. 3 is a flowchart of a method 300 for ensuring data consistencyaccording to the embodiments of the present disclosure. The actsinvolved in the method 300 will be described in the following text withreference to FIG. 2. For the ease of discussion, the depiction of themethod 300 involves two SPs, namely, SP 101 and SP 102. In FIG. 3, forexample, respective acts on the left side may be performed by SP 101while respective acts on the right side may be performed by SP 102. Inthe following depiction, the working buffer 201 and the first workingbuffer can be used interchangeably; the working buffer 202 and thesecond working buffer can be used interchangeably; the temporary buffer211 and the first temporary buffer can be used interchangeably; and thetemporary buffer 212 and the second temporary buffer can be usedinterchangeably. It is to be understood that the method 300 may furtherinclude additional acts not shown and/or omit the shown acts. The scopeof the present disclosure is not limited in this respect.

At block 301, data is written into the first temporary buffer 211 in SP101. For example, the data can be configuration information of thedisk(s) 103 to be updated, for example, the state information andmapping table of the RAID, or the like. Alternatively, the data can alsobe any other data with copies in SP 101, SP 102 and the disk(s) 103. Atblock 302, when the data is written into the temporary buffer 211, SP101 can transmit the data to SP 102 via CMI 104 to update the copy ofthe data in SP 102.

Correspondingly, at block 311, in response to receiving the data to beupdated from SP 101, SP 102 can write the data into the second temporarybuffer 212. Then, at block 312, an indication that SP 102 has receivedthe data is sent to SP 101.

At block 303, in response to receiving the indication, SP 101 can copythe data from the temporary buffer 211 to the working buffer 201.Additionally or alternatively, in some embodiments, the temporary buffer211 may be temporarily allocated for the data to be updated. In thisevent, once the data is copied to the working buffer 201, the temporarybuffer 211 can be released. At the other side, at block 313, SP 102 canalso copy the data from the temporary buffer 212 to the working buffer202. Additionally or alternatively, in some embodiments, the temporarybuffer 212 may be temporarily allocated for the data to be updated. Inthis event, when the data is copied to the working buffer 202, thetemporary buffer 212 can be released.

In other words, according to the embodiments of the present disclosure,before both SP 101 and SP 102 update data to respective temporarybuffers, neither of SP 101 and SP 102 will change data in its respectiveworking buffer. In this manner, if one or both of SP 101 and SP 102 failor break down, data in SP 101 and SP 102 can be kept consistent.

After being synchronized to SP 102 and copied from respective temporarybuffers to respective working buffers on SP 101 and SP 102, data can bestored in the disk(s) 103. As shown in FIG. 3, at block 304, SP 101 canwrite the data into the temporary region 204 on the disk(s) 103 sharedby SP 101 and SP 102. After that, at block 305, a flag (such as, journalheader) associated with the temporary region 204 can be set to indicatethat data in the temporary region 204 is valid. Additionally oralternatively, at block 306, SP 101 can send a first message containingthe flag to SP 102.

Correspondingly, at block 314, in response to receiving from SP 101 thefirst message indicating that the data is updated to the temporaryregion 204 on the disk(s) 103, SP 102 can obtain from the first messagethe flag indicating that data in the temporary region 204 is valid.Then, at block 315, a first acknowledgement that SP 102 has received thefirst message can be sent to SP 101.

Next, at block 307, SP 101 can write the data into the working region203 on the disk(s) 103. Additionally or alternatively, in response toreceiving the first acknowledgement, SP 101 can write the data into theworking region 203. Then, at block 308, SP 101 can set the flag (suchas, journal header) associated with the temporary region 204 to indicatethat data in the temporary region 204 is invalid.

In some embodiments, additionally or alternatively, at block 309, SP 101can send a second message containing the flag to SP 102.Correspondingly, at block 316, in response to receiving from SP 101 asecond message indicating that the data is updated to the working region203 on the disk(s) 103, SP 102 can obtain from the second message theflag indicating that data in the temporary region 204 is invalid. Next,at block 317, SP 102 can send to SP 101 a second acknowledgement that SP102 has received the second message.

In other words, if the system fails before the journal header is markedas invalid, the system may check the journal header in the next startingprocess and replay the data in the journal region to the working regionon the disk(s) 103, since the journal header indicates that there arevalid data in the journal region to be flushed to the disk. In thismanner, data on the disk(s) 103 and the SPs (such as SP 101 and 102) canbe kept consistent.

During the execution of the method 300, the system may fail, causing SP101 and/or SP 102 to be unable to work. Embodiments of the presentdisclosure can ensure data consistency among SP 101, SP 102 and thedisk(s) 103 under various failure conditions.

In some embodiments, at block 301 or 302, if SP 101 fails, the dataupdating request can be failed back to the requestor. However, if SP 102fails, SP 101 can determine that SP 102 has failured by detecting thatthe heartbeat signal transmitted via CMI 104 stops and continue the dataupdating process without performing SP synchronization.

In some embodiments, at blocks 311-313 or 303-305, if SP 101 fails, theupdating request can be failed over to SP 102. Since SP 102 has obtainedthe data to be updated, it can continue the data updating processwithout performing SP synchronization. At blocks 311-313 or 303-305, ifSP 102 fails, SP 101 can continue the data updating process withoutperforming SP synchronization.

In some embodiments, at blocks 314-315 or 307-309, if SP 101 fails, theupdating request can be failed over to SP 102, and SP 102 can serve asthe active SP and continue to perform the data updating process fromblock 307 without performing SP synchronization, since SP 102 hasobtained the journal header and learned that the data in the journalregion 204 is valid. At blocks 314-315 or 307-308, if SP 102 fails, SP101 can continue the data updating process without performing SPsynchronization.

In some embodiments, at block 316 or 317, if SP 101 fails, the updatingrequest can be failed over to SP 102 which can serve as the active SPand continue to perform the data updating process from block 316 withoutperforming SP synchronization. SP 102 can just clear respective datastructures and then report to the requester that the updating has beencompleted. At block 316 or 317, if SP 102 fails, SP 101 can continue thedata updating process without performing SP synchronization.

In some embodiments, at or before block 305, if both SP 101 and SP 102fail at the same time, though data in the memories on the SPs have beenupdated partially or completely, data on the disk(s) 103 has not beenupdated yet. In this event, SP 101 and SP 102 can be restarted to reloaddata from the disk(s) 103. Therefore, after the restarting, data on SP101, SP 102 and the disk(s) 103 are recovered back to the data beforethe updating. As the journal header is invalid, the process associatedwith the journal region will not occur during the restarting period.

In some embodiments, after block 305 and before block 308 (including atblock 308) if both SP 101 and SP 102 fail at the same time, SP 101 andSP 102 can be restarted. During the restarting period, in response todetecting that the journal header is valid, data in the journal regioncan be replayed or flushed to the working region 203 on the disk(s) 103.After replaying the journal, the data on the disk(s) 103 will be theupdated. By reloading the data on the disk(s) 103 to SP 101 and SP 102,the data on SP 102, SP 102 and the disk(s) 103 will be kept consistent(that is, the updated data).

In some embodiments, after block 308, if both SP 101 and SP 102 fail,they can be restarted. During the restarting period, in response todetecting that the journal header is invalid, it can be learned thatdata on the disk(s) 103 have been updated. By reloading the data on thedisk(s) 103 to SP 101 and 102, the data on SP 102, SP 102 and thedisk(s) 103 will be kept consistent (that is, the updated data).

As stated above, the embodiments of the present disclosure can ensuredata consistency among the memories of the plurality of SPs by firstlyupdating data to the temporary buffers in SPs and copying data from thetemporary buffers of the SPs to the working buffer once the data isupdated to the temporary buffers of all the SPs. Furthermore, during theperiod when the data is flushed from the memories of the SPs to thedisk, the embodiments of the present disclosure can ensure dataconsistency among the memories and the disk by employing the journalregion on the disk.

FIG. 4 is a block diagram of an apparatus 400 for ensuring dataconsistency according to the embodiments of the present disclosure. Forexample, SP 101 shown in FIG. 2 can be implemented by the apparatus 400.As shown in FIG. 4, the apparatus 400 includes an access control module410 which may be configured to write data into the temporary buffer 211in SP 101. The apparatus 400 further includes a transmission module 420which may be configured to send the data to SP 102 to update a copy ofthe data in SP 102 responsive to the data being written into thetemporary buffer 211. Furthermore, the access control module 410 may befurther configured to copy the data from the temporary buffer 211 to theworking buffer 201 in SP 101 in response to receiving an indication thatSP 102 has received the data.

FIG. 5 is a block diagram of an apparatus 500 for ensuring dataconsistency according to the embodiments of the present disclosure. Forexample, SP 102 shown in FIG. 2 can be implemented by the apparatus 500.As shown in FIG. 5, the apparatus 500 includes an access control module510 which may be configured to write the data to be updated into thetemporary buffer 212 in SP 102 in response to receiving the data fromthe SP 101. The apparatus 500 further includes a transmission module 520which may be configured to, in response to the data being written intothe temporary buffer 212, send an indication to SP 101 that SP 102 hasreceived the data. Furthermore, the access control module 510 may befurther configured to copy the data from the temporary buffer 212 to theworking buffer 202 in SP 102.

For the sake of clarity, some optional modules of the apparatus 400and/or 500 are not shown in FIG. 4 and/or FIG. 5. However, it is to beunderstood that various features as described with reference to FIGS.2-3 are likewise applicable to the apparatus 400 and/or 500. Besides,respective modules of the apparatus 400 and/or 500 may be hardwaremodules or software modules. For example, in some embodiments, theapparatus 400 and/or 500 may be partially or completely implemented bysoftware and/or firmware, e.g., implemented as a computer programproduct embodied on a computer readable medium. Alternatively oradditionally, the apparatus 400 and/or 500 may be partially orcompletely implemented based on hardware, for example, implemented as anintegrated circuit (IC) chip or an application specific integratedcircuit (ASIC), a system on chip (SOC), a field programmable gate array(FPGA) and so on. The scope of the present disclosure is not limited inthis aspect.

FIG. 6 is a schematic block diagram of an example apparatus 600 that canbe used to implement the embodiments of the present disclosure. Forexample, SP 101 and/or SP 102 as shown in FIG. 2 can be implemented bythe apparatus 600. As shown in FIG. 6, the apparatus 600 includes acentral processing unit (CPU) 601 which may perform various appropriateactions and processing based on computer program instructions stored inthe read only memory (ROM) 602 or computer program instructions uploadedfrom storage unit 608 to the random access memory (RAM) 603. In the RAM603, there further stores various programs and data needed by operationof the apparatus 600. The CPU 601, ROM 602 and RAM 603 are connected oneanother via a bus 604. The input/output (I/O) interface 605 is alsoconnected to the bus 604.

The following components in the apparatus 600 are connected to the I/Ointerface 605: including: an input unit 606, such as a keyboard, amouse, and the like; an output unit 607, such as display of varioustypes and loudspeakers; a storage unit 608, such as magnetic disk andoptical disk; a communication unit 609, such as network card, modem,wireless communication transceiver. The communication unit 609 allowsthe apparatus 600 to exchange data/information with other devices viacomputer networks, such as Internet and/or telecommunication networks.

The processes and processing described above, the method 300 forinstance, can be executed by the processing unit 601. For example, insome implementations, the method 300 can be implemented as a computersoftware program which is corporeally contained in a machine readablemedium, such as the storage unit 608. In some implementations, thecomputer program can be partially or wholly loaded and/or mounted on theapparatus 600 by the ROM 602 and/or the communication unit 609. When thecomputer program is uploaded to the RAM 603 and executed by the CPU 601,one or more steps of the method 300 described above can be executed.

The present disclosure may be a system, an apparatus, a device, amethod, and/or a computer program product. The computer program productmay include a computer readable storage medium (or media) havingcomputer readable program instructions thereon for causing a processorto carry out aspects of the present disclosure.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local region network,a wide region network and/or a wireless network. The network maycomprise copper transmission cables, optical transmission fibers,wireless transmission, routers, firewalls, switches, gateway computersand/or edge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present disclosure may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, or either source code or object code written in anycombination of one or more programming languages, including an objectoriented programming language such as Smalltalk, C++ or the like, andconventional procedural programming languages, such as the “C”programming language or similar programming languages. The computerreadable program instructions may execute entirely on the user'scomputer, partly on the user's computer, as a stand-alone softwarepackage, partly on the user's computer and partly on a remote computeror entirely on the remote computer or server. In the latter scenario,the remote computer may be connected to the user's computer through anytype of network, including a local region network (LAN) or a wide regionnetwork (WAN), or the connection may be made to an external computer(for example, through the Internet using an Internet Service Provider).In some embodiments, electronic circuitry including, for example,programmable logic circuitry, field-programmable gate arrays (FPGA), orprogrammable logic arrays (PLA) may execute the computer readableprogram instructions by utilizing state information of the computerreadable program instructions to personalize the electronic circuitry,in order to perform aspects of the present disclosure.

Aspects of the present disclosure are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of thepresent disclosure. It will be understood that each block of theflowchart illustrations and/or block diagrams, and combinations ofblocks in the flowchart illustrations and/or block diagrams, can beimplemented by computer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams illustrate the architecture,functionality, and operation of possible implementations of systems,methods and computer program products according to various embodimentsof the present disclosure. In this regard, each block in the flowchartor block diagrams may represent a module, snippet, or portion of code,which comprises one or more executable instructions for implementing thespecified logical function(s). In some alternative implementations, thefunctions noted in the block may occur out of the order noted in thefigures. For example, two blocks shown in succession may, in fact, beexecuted substantially concurrently, or the blocks may sometimes beexecuted in the reverse order, depending upon the functionalityinvolved. It will also be noted that each block of the block diagramsand/or flowchart illustration, and combinations of blocks in the blockdiagrams and/or flowchart illustration, can be implemented by specialpurpose hardware-based systems that perform the specified functions oracts, or combinations of special purpose hardware and computerinstructions.

The descriptions of the various embodiments of the present disclosurehave been presented for purposes of illustration, but are not intendedto be exhaustive or limited to the embodiments disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope and spirit of the describedembodiments. The terminology used herein was chosen to best explain theprinciples of the embodiments, the practical application or technicalimprovement over technologies found in the marketplace, or to enableothers of ordinary skill in the art to understand the embodimentsdisclosed herein.

We claim:
 1. A method of ensuring data consistency, comprising: writingdata into a first temporary buffer in a first processor; in response tothe data being written into the first temporary buffer, sending the datato a second processor to update a copy of the data in the secondprocessor; and in response to receiving an indication that the secondprocessor has received the data, copying the data from the firsttemporary buffer to a first working buffer in the first processor. 2.The method according to claim 1, further comprising: in response to thedata being copied to the first working buffer, releasing the firsttemporary buffer.
 3. The method according to claim 1, furthercomprising: writing the data into a temporary region on a disk shared bythe first and second processors; in response to the data being writteninto the temporary region, setting a flag associated with the temporaryregion to indicate that the data in the temporary region is valid;writing the data into a working region on the disk; and in response tothe data being written into the working region, setting the flag toindicate that the data in the temporary region is invalid.
 4. The methodaccording to claim 3, further comprising: in response to the flag beingset to indicate that the data in the temporary region is valid, sendinga first message containing the flag to the second processor.
 5. Themethod according to claim 4, wherein writing the data into the workingregion on the disk comprises: in response to receiving anacknowledgement that the second processor has received the firstmessage, writing the data into the working region.
 6. The methodaccording to claim 3, further comprising: in response to the flag beingset to indicate that the data in the temporary region is invalid,sending a second message containing the flag to the second processor. 7.A method for ensuring data consistency, comprising: in response toreceiving from a first processor data to be updated, writing the datainto a second temporary buffer in a second processor; in response to thedata being written into the second temporary buffer, sending, to thefirst processor, an indication that the second processor has receivedthe data; and copying the data from the second temporary buffer to asecond working region in the second processor.
 8. The method accordingto claim 7, further comprising: in response to the data being copied tothe second working buffer, releasing the second temporary buffer.
 9. Themethod according to claim 7, further comprising: in response toreceiving from the first processor a first message indicating that thedata is updated to a temporary region on a disk shared by the first andsecond processors, obtaining, from the first message, a flag indicatingthat the data in the temporary region is valid; and sending, to thefirst processor, a first acknowledgement that the second processor hasreceived the first message.
 10. The method according to claim 9, furthercomprising: in response to receiving from the first processor a secondmessage indicating that the data is updated to a working region on thedisk, obtaining, from the second message, the flag indicating that thedata in the temporary region is invalid; and sending, to the firstprocessor, a second acknowledgement that the second processor hasreceived the second message.
 11. The method according to claim 7,further comprising: in response to determining that the first processoris unresponsive: writing the data into a temporary region on the diskshared by the first and second processors; in response to the data beingwritten into the temporary region, setting a flag associated with thetemporary region to indicate that the data in the temporary region isvalid; writing the data into a working region on the disk; and inresponse to the data being written into the working region, setting theflag to indicate that the data in the temporary region is invalid. 12.An apparatus for ensuring data consistency, comprising: at least oneprocessing unit; at least one memory coupled to the at least oneprocessing unit and storing instructions for execution by the at leastone processing unit, the instructions, when executed by the at least oneprocessing unit, causing the apparatus to: write data into a firsttemporary buffer in a first processor; in response to the data beingwritten into the first temporary buffer, send the data to a secondprocessor to update a copy of the data in the second processor; and inresponse to receiving an indication that the second processor hasreceived the data, copy the data from the first temporary buffer to afirst working buffer in the first processor.
 13. The apparatus accordingto claim 12, wherein the instructions, when executed by the at least oneprocessing unit, further cause the apparatus to: in response to the databeing copied to the first working buffer, release the first temporarybuffer.
 14. The apparatus according to claim 12, wherein theinstructions, when executed by the at least one processing unit, furthercause the apparatus to: write the data into a temporary region on a diskshared by the first and second processors; in response to the data beingwritten into the temporary region, set a flag associated with thetemporary region to indicate that the data in the temporary region isvalid; write the data into a working region on the disk; and in responseto the data being written into the working region, set the flag toindicate that the data in the temporary region is invalid.
 15. Theapparatus according to claim 14, wherein the instructions, when executedby the at least one processing unit, further cause the apparatus to: inresponse to the flag being set to indicate that the data in thetemporary region is valid, send a first message containing the flag tothe second processor.
 16. The apparatus according to claim 15, whereinwriting the data into the working region on the disk comprises: inresponse to receiving an acknowledgement that the second processor hasreceived the first message, writing the data into the working region.17. The apparatus according to claim 14, wherein the instructions, whenexecuted by the at least one processing unit, further cause theapparatus to: in response to the flag being set to indicate that thedata in the temporary region is invalid, send a second messagecontaining the flag to the second processor.